﻿<Page
    x:Name="pageRoot"
    x:Class="Antares.VIEWs.ApprovePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Antares.VIEWs"
    xmlns:common="using:Antares.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Common="using:AntaresShell.Common"
    xmlns:VIEWMODELs="using:Antares.VIEWMODELs" mc:Ignorable="d">

    <Page.DataContext>
        <VIEWMODELs:ApproveViewModel/>
    </Page.DataContext>
    <Page.Resources>
        <Style x:Key="CommonTextStyle" TargetType="HyperlinkButton">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontSize" Value="36"/>
            <Setter Property="FontWeight" Value="ExtraLight"/>
            <Setter Property="Foreground" Value="Black"/>
        </Style>
        <DataTemplate
                x:Key="ProjectInformationItem">
            <local:ProjectInformationItem/>
        </DataTemplate>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Style="{StaticResource LayoutRootStyle}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0"/>
                <ColumnDefinition Width="1.2*"/>
                <ColumnDefinition Width="4.5*"/>
                <ColumnDefinition Width="50"/>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="5"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="100"/>
            </Grid.RowDefinitions>

            <StackPanel Grid.Column="2" Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right">
                <Button 
					x:Name="acceptButton"
                    Command="{Binding ApprovedCommand}"
                    Style="{StaticResource YesAppBarButtonStyle2}"
                        Visibility="Visible"
                       AutomationProperties.Name="{Binding Resource[Wtig_Accepted]}"
                    />
                <Button 
					x:Name="rejectButton"
                    Command="{Binding UnapprovedCommand}"
                    Style="{StaticResource NoAppBarButtonStyle2}"
                        Visibility="Visible"
                       AutomationProperties.Name="{Binding Resource[Wtig_Rejected]}"
                    />

                <StackPanel.Transitions>
                    <TransitionCollection>
                        <PopupThemeTransition FromHorizontalOffset="100"/>
                    </TransitionCollection>
                </StackPanel.Transitions>
            </StackPanel>

            <Rectangle Fill="LightBlue"
                   Width="1"
                       Grid.Row="1"
                   Grid.Column="2"
                   HorizontalAlignment="Left"
                       Margin="-10,0,0,0"/>

            <StackPanel Margin="0,-10,0,0" Grid.Column="1" Grid.Row="1"  VerticalAlignment="Top" HorizontalAlignment="Left">
                <HyperlinkButton Tapped="TaskTxt_Tapped_1" Content="{Binding Resource[Wtig_Task]}" Style="{StaticResource CommonTextStyle}"  x:Name="TaskTxt"/>
                <HyperlinkButton Opacity="0.4" Tapped="ProjectTxt_Tapped_1" Margin="0,15,0,0" Content="{Binding Resource[Wtig_Project]}" Style="{StaticResource CommonTextStyle}" x:Name="ProjectTxt"/>
            </StackPanel>
            <FlipView x:Name="FlipView" Grid.Column="2" Grid.Row="1" SelectionChanged="FlipView_SelectionChanged_1">
                <FlipView.Transitions>
                    <TransitionCollection>
                        <EdgeUIThemeTransition Edge="Right"/>
                    </TransitionCollection>
                </FlipView.Transitions>
                <FlipViewItem>
                    <GridView x:Name="TaskGrid" SelectionMode="Multiple" SelectionChanged="TaskGrid_SelectionChanged_1" ItemsSource="{Binding UnapprovedTasks}" Margin="0,0,10,0">
                        <GridView.ItemTemplate>
                            <DataTemplate>
                                <Grid Height="90" Width="292">
                                    <!--<Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="auto"/>
                                    </Grid.ColumnDefinitions>-->
                                <Grid.Resources>
                                    <Style x:Key="TxtProjectStyle" TargetType="TextBlock">
                                        <Setter Property="FontFamily" Value="Segoe UI"/>
                                        <Setter Property="FontWeight" Value="SemiLight"/>
                                        <Setter Property="Foreground" Value="White"/>
                                        <Setter Property="FontSize" Value="24"/>
                                    </Style>

                                    <Style x:Key="DateTimeStyle" TargetType="TextBlock">
                                        <Setter Property="FontFamily" Value="Segoe UI"/>
                                        <Setter Property="FontWeight" Value="SemiLight"/>
                                        <Setter Property="Foreground" Value="White"/>
                                        <Setter Property="FontSize" Value="16"/>
                                    </Style>

                                   
                                </Grid.Resources>
                                <Rectangle Margin="0,2.5,0,0"   Grid.ColumnSpan="3" Grid.RowSpan="5"  Fill="#203c1e"></Rectangle>

                                <StackPanel Margin="5,5,5,0" >
                                    <TextBlock Style="{StaticResource TxtProjectStyle}" Text="{Binding Name}"></TextBlock>
                                    <TextBlock Style="{StaticResource DateTimeStyle}" Text="{Binding Description}"></TextBlock>
                                    <TextBlock Style="{StaticResource DateTimeStyle}" Text="{Binding ProjectName}" HorizontalAlignment="Right" Opacity="0.8"></TextBlock>
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </GridView.ItemTemplate>
                    </GridView>
                </FlipViewItem>
                <FlipViewItem>
                <GridView x:Name="ProjectGrid" SelectionMode="Multiple" SelectionChanged="ProjectGrid_SelectionChanged_1" SelectedItem="{Binding SelectedProjects, Mode=TwoWay}"  ItemsSource="{Binding UnapprovedProjects}"   Margin="0,0,10,0">
                        <GridView.ItemTemplate>
                            <DataTemplate>
                                <Grid Height="120" Width="260">
                                    <!--<Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="auto"/>
                                    </Grid.ColumnDefinitions>-->
<Grid.Resources>
        <Style x:Key="TxtProjectStyle" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="SemiLight"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="35"/>
        </Style>

        <Style x:Key="DateTimeStyle" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="SemiLight"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="16"/>
        </Style>

    </Grid.Resources>
    <Grid.RowDefinitions>
        <RowDefinition Height="10"/>
        <RowDefinition Height="5*"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="10"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="10"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="10"/>
    </Grid.ColumnDefinitions>

    <Image Grid.RowSpan="4" Grid.ColumnSpan="3" Stretch="Fill" Source="/Assets/Folder.png" Opacity="0"/>
                                <Rectangle Grid.RowSpan="4" Grid.ColumnSpan="3" Fill="#046380"/>
     <StackPanel Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" Grid.RowSpan="3" >
        <TextBlock Style="{StaticResource TxtProjectStyle}" FontSize="20" Text="{Binding ProjectName}"/>
    </StackPanel>

                              

                                    <!--<CheckBox Grid.Column="1" VerticalAlignment="Center" Content="Approve" IsChecked="{Binding IsConfirmed}"/>-->
                                </Grid>
                            </DataTemplate>
                        </GridView.ItemTemplate>
                    </GridView>
                </FlipViewItem>
            </FlipView>
    </Grid>
</Page>
